/*CopyRight 2015 By YXKJ Co., Ltd. All Rights Reserved.*/
package com.yx.system.component;

import java.util.List;
import java.util.Set;
import org.eclipse.jface.viewers.Viewer;

/**
 * 通用内容提供器
 * 
 * @author zgq
 */
public class ContentProvider implements
		org.eclipse.jface.viewers.IStructuredContentProvider {
	@Override
	public void dispose() {
	}

	@Override
	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
	}

	@Override
	public Object[] getElements(Object inputElement) {
		if (inputElement instanceof List)
			return ((List<?>) inputElement).toArray();
		else if (inputElement instanceof Set)
			return ((Set<?>) inputElement).toArray();
		return (Object[]) inputElement;
	}
}
